package com.cooper.scraper.show;

import java.util.List;

import android.content.Context;
import android.view.Display;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ListView;



public class ListFanartShow<T extends OnlineFanartResource> extends FanartsShow<T> {

	private ListView listView;
	
	private int fanartWidth;
	private int fanartHeight;
	
	
	public ListFanartShow(Context context, FanartViewStrategy<T> fanartStrategy,int watingImageRes) {
		super(context, fanartStrategy,watingImageRes);
		// TODO Auto-generated constructor stub
	}

	@Override
	protected void init() {
		super.init();
		
		listView = new ListView(context);
		listView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.MATCH_PARENT));


	}

	@Override
	public int getFanartShowCount() {
		WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
	    Display display = wm.getDefaultDisplay();
		

	    return (display.getHeight() / fanartHeight + 2) * (display.getWidth() / fanartWidth);
	
	}

	@Override
	public void setCommands(List<ResourceCommandAction<T>> commands) {
		// TODO Auto-generated method stub

	}

	@Override
	protected FanartImgStrategy getFanartImgStrategy() {
		// TODO Auto-generated method stub mybe modify
		return CrystalFanartImgStrategy.getInstance();
	}

	@Override
	protected AdapterView<?> getAdapterView() {
		return listView;
	}

	@Override
	public void removeFrom(ViewGroup from) {
		from.removeView(listView);
	}

	@Override
	public void showTo(ViewGroup to) {
		to.addView(listView);
	}

	@Override
	public void setSelection(int position, boolean animate) {
		// TODO Auto-generated method stub

	}

	@Override
	public void hideOrShowFanartsView() {
	}

	@Override
	public void resetSelected() {
		// TODO Auto-generated method stub

	}

	@Override
	public int dataAddDirection() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	protected float getFanartWidth() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	protected float getFanartHeight() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	protected LayoutParams getFanartViewLayoutParams() {
		// TODO Auto-generated method stub
		return null;
	}

}
